import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';

@Entity({ name: 't_user_area' })
@Index('t_user_area', ['userId', 'areaId'], { unique: true })
export class UserArea {
  @PrimaryGeneratedColumn({ type: 'int' })
  id: number;

  @Column({ type: 'int', nullable: false, comment: '用户ID', name: 'user_id' })
  userId: number;

  @Column({ type: 'int', nullable: false, comment: '区域ID', name: 'area_id' })
  areaId: number;

  @CreateDateColumn({ name: 'created_at' })
  createdAt: Date;

}
